<cfinclude template="/ecada/header.cfm">

<cfoutput>

<cfquery datasource="exp" name="numtrials">
    	select trial.id as id, location, expconditions.description as
    	conddescription, ispicture, stimuli.answer, stimuli.question
    	from trial, stimuli, expconditions where trial.expid=#id#
    	and trial.stimid = stimuli.id 
    	and condid=expconditions.id
    	order by condid 
    </cfquery>

<cfquery datasource="exp" name="expname">
select * from experiment where id=#id#
</cfquery>

<h1>Individual trials for #expname.title# Experiment</h1>
<cfloop query = numtrials>



<table border = 1><tr><td>
<cfif #ispicture# eq 1>
<img src="/ecada/#numtrials.location#" width=100></td><td>
<font color="red">Image:</font>#GetFileFromPath(numtrials.location)#<br>
<font color="red">Condition:</font> #numtrials.conddescription#<br>
<font color="red">Question:</font> #numtrials.question#<br>
<font color="red">Answer:</font> #numtrials.answer#

<cfelse>
<a href="/ecada/analyse/answersgiven.cfm?trialid=#numtrials.id#"><img src="/ecada/images/placeholder.png"></a></td><td>
<font color="red">File:</font> #GetFileFromPath(numtrials.location)#<br>
<font color="red">Condition:</font> #numtrials.conddescription#

</cfif>
</td></tr></table>
</cfloop>

</cfoutput>


<cfinclude template="/ecada/footer.cfm">
